//package top.cluski.shardingsphere.algorithm;
//
//import org.apache.shardingsphere.api.sharding.hint.HintShardingAlgorithm;
//import org.apache.shardingsphere.api.sharding.hint.HintShardingValue;
//
//import java.util.Arrays;
//import java.util.Collection;
//import java.util.Collections;
//
//public class MyHintTableShardingAlgorithm implements HintShardingAlgorithm<Integer> {
//    // select * from course;
//    @Override
//    public Collection<String> doSharding(Collection<String> collection, HintShardingValue<Integer> hintShardingValue) {
//        Integer courseNum = (Integer) hintShardingValue.getValues().toArray()[0];
//        String key = hintShardingValue.getLogicTableName() + "_" + courseNum;
//        if (collection.contains(key)) {
//            return Collections.singletonList(key);
//        }
//
//        throw new UnsupportedOperationException("route" + key + "is not supported, please check your config.");
//    }
//}
